package com.atguigu.srb.core.controller.admin;

import com.atguigu.common.result.R;
import com.atguigu.srb.core.pojo.entity.UserLoginRecord;
import com.atguigu.srb.core.service.UserLoginRecordService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author gcq
 * @Create 2021-05-02
 */
@Api(tags = "会员登录日志接口")
@RequestMapping("/admin/core/userLoginRecord")
@RestController
public class AdminUserLoginRecordController {

    @Autowired
    UserLoginRecordService userLoginRecordService;

    @ApiOperation("查询用户操作日志前50条")
    @GetMapping("/listTop50/{id}")
    public R listTop50(@ApiParam("会员id") @PathVariable("id") Long id)
    {
        List<UserLoginRecord> list = userLoginRecordService.listTop50(id);
        return R.ok().data("list", list);
    }
}